<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>04methods</title>
  <script src="js/vue.js"></script>
</head>
<body>
<div id="div">
  <input type="button" v-on:click="f1()" value="点击">
  <input type="button" v-on:click="f2()" value="点击">
  <input type="text" v-model="num" @blur="f3()">
</div>
<script>
  var vm = new Vue({
    el:"#div",
    data:{
      num:1
    },
    methods:{
      f1:function (){
        alert("弹框。。。")
      },
      f2:function (){
        alert("弹框2")
      },
      f3:function (){
        //this表示当前对象，vm表示vue对象
        this.num++;
      }
    }
  })
</script>
</body>
</html>